poem = ["白日依山尽个", 'iuad2e891298gsagdha', "ndsakjshda767576", "dadsd31231213"]

# 居中显示
for str in poem:
    print("|%s|" % str.center(50, " "))

print("-----------------------------------------------------------------------------------------")

# 左对齐
for str in poem:
    print("|%s|" % str.ljust(50, " "))

print("-----------------------------------------------------------------------------------------")

# 右对齐
for str in poem:
    print("|%s|" % str.rjust(50, " "))

poem = "123456789\t 白日依山尽个 \t dasdasdasdas\t 123123123112312"
print("poem", poem)

# 拆分字符串
poem_split = poem.split()
print("poem_split", poem_split)

# 合并字符转
join = "".join(poem_split)
print("join", join)

# 拆分字符串
poem_split = poem.split("尽个")
print("poem_split", poem_split)

# 切片
print("切片就要2-6", poem[2:6])

# 开头两个字符  :: 表示步长
print("切片 就要0-2", poem[0:2])
print("切片 除偶数", poem[::2])
print("切片 就要倒数第一个", poem[-1])
print("切片 去除了倒数第一个", poem[::-1])
print("切片 2-导师第一", poem[2:-1])
print("切片 末尾两个字符", poem[-2:])
print("切片 倒序", poem[-1::-1])
